<?php
class App_Tpl_Form_Field_Radio extends App_Tpl_Form_Field{

	public function PreparePost($fieldPostData, $params)
	{
		$fieldPostData = (string)$fieldPostData;
		
		$values = (array)$params['values'];
		if (!$values || !array_key_exists($fieldPostData, $values)) $fieldPostData = null;
		
		return $fieldPostData;
	}

	public function PrepareOut($fieldData, $params)
	{
		return (string)$fieldData;
	}
	
    protected function RenderField()
    {
    	return $this->render('form/field/_radio.phtml');
    }
	
}